<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    
</head>
<body>
    <div id="app">
        <!-- v-model="msg" 数据的双向绑定 -->
        <input type="text" name="" id="" v-model="msg" />
        <button @click="change">转大写</button>
       
    </div>
    <script src="./js/vue.js"></script>
    <script>
        //新建vue对象
        let app = new Vue({
            //挂载
            el:"#app", 
            //数据定义
            data:{ 
                msg:"aaa",
            },
            //定义函数
            methods:{
                change:function(){
                    //想要调用 data中的数据，必须写成 this.变量名
                    this.msg = this.msg.toUpperCase();
                    //return this.msg.toUpperCase();
                }
            }
        })
    </script>
</body>
</html>